<?
if(!defined ('U_MOD'))
{
	echo"<meta http-equiv='refresh' content='0;url=/index.php'>";
	exit;
}

include 'topmenu.php';

$query=mysql_query("SELECT * FROM ".$PortalPref.$amk." WHERE modules_key <> 'index'");
print '<table align="center" width="100%">
	<tr>
		<td id="column-title">'._VERSION_.'</td>
		<td id="column-title">'._NAME_.'</td>
		<td id="column-title">'._DOACT_.'</td>
	</tr>';
		$dd=1;
		while($result=mysql_fetch_assoc($query))
		{
			if ($result['modules_system']==1)
			{
				$sysIcon='<img src="'.$portal_url.'/images/icon/16x16_png/alert.png" id="img-action" title="'._SYS_MODULE_TITLE_.'" >';
				$delIcon='';
			}else
			{
				$sysIcon='';
				$delIcon='<a href="'.$portal_url.'/admin.php?amk='.$amk.'&apk=change&act=1&mid='.$result['modules_id'].'" onClick="return confirm(\''._CLICKDEL_.' '._THISMODULE_.': '.$result['modules_a_name'].'\');"><img src="'.$portal_url.'/images/icon/16x16_png/delete.png" id="img-action" title="'._DEL_TITLE_.'" ></a>';
			}

			$modifyIcon='<a href="'.$portal_url.'/admin.php?amk='.$amk.'&apk=manage&act=3&mid='.$result['modules_id'].'"><img src="'.$portal_url.'/images/icon/16x16_png/modify.png" id="img-action" title="'._MODIFY_TITLE_.'" ></a>';

			$wrenchIcon='<a href="'.$portal_url.'/admin.php?amk=option&mkey='.$result['modules_key'].'"><img src="'.$portal_url.'/images/icon/16x16_png/wrench.png" id="img-action" title="'._SET_TITLE_.'" ></a>';

			if ($result['modules_u_active']==1)
			{
				if ($result['modules_system']!=1)
				{
					$aBegin='<a href="'.$portal_url.'/admin.php?amk='.$amk.'&apk=change&act=2&mid='.$result['modules_id'].'">';
					$aEnd='</a>';
					$aTitle=_UACTIVE_MODULE_TITLE_Y_;
				}else
				{
					$aBegin='';
					$aEnd='';
					$aTitle=_UACTIVE_TITLE_Y_;
				}
				$uActivityIcon=$aBegin.'<img src="'.$portal_url.'/images/icon/16x16_png/yes.png" id="img-action" title="'.$aTitle.'" >'.$aEnd;
			}elseif($result['modules_u_active']==0)
			{
				if ($result['modules_system']!=1)
				{
					$aBegin='<a href="'.$portal_url.'/admin.php?amk='.$amk.'&apk=change&act=3&mid='.$result['modules_id'].'">';
					$aEnd='</a>';
					$aTitle=_UACTIVE_MODULE_TITLE_N_;
				}else
				{
					$aBegin='';
					$aEnd='';
					$aTitle=_UACTIVE_TITLE_N_;
				}
				$uActivityIcon=$aBegin.'<img src="'.$portal_url.'/images/icon/16x16_png/warning.png" id="img-action" title="'.$aTitle.'" >'.$aEnd;
			}

			if ($result['modules_a_active']==1)
			{
				if ($result['modules_system']!=1)
				{
					$aBegin='<a href="'.$portal_url.'/admin.php?amk='.$amk.'&apk=change&act=4&mid='.$result['modules_id'].'">';
					$aEnd='</a>';
					$aTitle=_AACTIVE_MODULE_TITLE_Y_;
				}else
				{
					$aBegin='';
					$aEnd='';
					$aTitle=_AACTIVE_TITLE_Y_;
				}
				$aActivityIcon=$aBegin.'<img src="'.$portal_url.'/images/icon/16x16_png/yes.png" id="img-action" title="'.$aTitle.'" >'.$aEnd;
			}elseif($result['modules_a_active']==0)
			{
				if ($result['modules_system']!=1)
				{
					$aBegin='<a href="'.$portal_url.'/admin.php?amk='.$amk.'&apk=change&act=5&mid='.$result['modules_id'].'">';
					$aEnd='</a>';
					$aTitle=_AACTIVE_MODULE_TITLE_N_;
				}else
				{
					$aBegin='';
					$aEnd='';
					$aTitle=_AACTIVE_TITLE_N_;
				}
				$aActivityIcon=$aBegin.'<img src="'.$portal_url.'/images/icon/16x16_png/warning.png" id="img-action" title="'.$aTitle.'" >'.$aEnd;
			}

			$dd++;$iclass = ($dd % 2) ? "even" : "odd";
			print '<tr id="'.$iclass.'">
				<td>'.$result['modules_version'].'</td>
				<td>'.pEcho($result['modules_a_name']).'</td>
				<td id="column-action">'.$uActivityIcon.''.$aActivityIcon.''.$wrenchIcon.''.$modifyIcon.''.$delIcon.''.$sysIcon.'</td>
			</tr>';
		}
print '</table>';
?>